
import store from "@/store";
export default {
    formJson: {
        // 接口路径
        interfacer: "task/complete",
        method: "PUT",
        params: {
            // 接口提交参数
        },
        // 表单内容，二级表单
        formSchemaArray: [
            {
                // 表单名称
                formTitle: "表单一",
                // 表单数据
                formData: {},
                // 表单字段
                formSchema: [
                    // input单行输入表单
                    {
                        component: 'input',
                        label: '用户名',
                        name: 'username',
                        placeholder: '请输入用户名',
                        readonly: false,
                        // 星号是否显示
                        required: true,
                        rules: [
                            {
                                required: true,
                                errorMessage: '请输入用户名',
                                trigger: 'blur'
                            },
                            {
                                minLength: 3,
                                maxLength: 5,
                                errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符',
                            },
                        ]
                    },
                    // textarea多行输入表单
                    {
                        component: 'textarea',
                        label: '备注',
                        name: 'remark',
                        placeholder: '请输入备注',
                        readonly: false,
                        // 星号是否显示
                        required: true,
                        maxlength: 200,
                        rules: [
                            {
                                required: true,
                                errorMessage: '请输入备注',
                                trigger: 'blur'
                            },
                            {
                                minLength: 0,
                                maxLength: 200,
                                errorMessage: '备注长度不能超过 {maxLength} 个字符',
                            },
                        ]
                    },
                    // checkbox单选框表单
                    {
                        component: 'checkbox',
                        label: '性别',
                        name: 'gender',
                        // 单选
                        multiple: false,
                        placeholder: '请选择性别',
                        readonly: false,
                        options: [{"value": 0,"text": "女性"},{"value": 1,"text": "男性"},{"value": 99,"text": "未知","disable": true}],
                        // 星号是否显示
                        required: true,
                        rules: [
                            {
                                required: true,
                                errorMessage: '请选择性别',
                                trigger: 'blur'
                            },
                            
                        ]
                    },
                    // checkbox多选框表单
                    {
                        component: 'checkbox',
                        label: '爱好',
                        name: 'hobby',
                        // 多选
                        multiple: true,
                        placeholder: '请输入用户名',
                        readonly: false,
                        options: [{"value": 0,"text": "篮球"},{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}],
                        // 星号是否显示
                        required: true,
                        rules: [
                            {
                                required: true,
                                errorMessage: '至少选择一个兴趣爱好',
                                trigger: 'blur'
                            },
                            
                        ]
                    },
                    {
                        component: 'file',
                        label: '附件',
                        name: 'files',
                        // 附件数量
                        size: 5,
                        placeholder: '',
                        readonly: false,
                        // 星号是否显示
                        required: true,
                        rules: [
                            {
                                required: true,
                                errorMessage: '至少上传一个附件',
                                trigger: 'blur'
                            },
                            
                        ]
                    },
                ]
            },
        ],
    },
};
